package com.bwsoft.portal.action;

import java.io.File;
import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.apache.log4j.Logger;

import com.bwsoft.action.BaseAction;
import com.bwsoft.admin.domain.Account;
import com.bwsoft.admin.domain.News;
import com.bwsoft.admin.service.AdService;
import com.bwsoft.admin.service.BannerService;
import com.bwsoft.admin.service.NewsCategoryService;
import com.bwsoft.admin.service.NewsService;
import com.bwsoft.api.service.DictionaryService;
import com.bwsoft.model.Message;
import com.bwsoft.portal.service.AccountAccessService;
import com.bwsoft.portal.service.AccountService;
import com.bwsoft.portal.service.CodeService;
import com.bwsoft.portal.service.IndexPageService;
import com.bwsoft.portal.service.QualityControlService;
import com.bwsoft.portal.service.RegisterService;
import com.bwsoft.portal.service.ReportService;
import com.bwsoft.portal.service.StandardService;

public class PortalBaseAction extends BaseAction {

	private static Logger LOG = Logger.getLogger(PortalBaseAction.class);

	@Resource(name = BannerService.NAME)
	public BannerService bannerService;
	
	@Resource(name = NewsService.NAME)
	public NewsService newsService;
	
	@Resource(name = NewsCategoryService.NAME)
	public NewsCategoryService newsCategoryService;
	
	@Resource(name = IndexPageService.NAME)
	public IndexPageService indexPageService;
	
	@Resource(name = AdService.NAME)
	public AdService adService;
	
	@Resource(name = RegisterService.NAME)
	public RegisterService regService;
	
	@Resource(name = CodeService.NAME)
	public CodeService codeService;
	
	@Resource(name = DictionaryService.NAME)
	public DictionaryService  dictionaryService;

	@Resource(name = AccountService.NAME)
	public AccountService accountService;
	
	@Resource(name = StandardService.NAME)
	public StandardService standardService;
	
	@Resource(name = QualityControlService.NAME)
	public QualityControlService qualityControlService;
	
	@Resource(name = ReportService.NAME)
	public ReportService reportService;
	
	@Resource(name = AccountAccessService.NAME)
	public AccountAccessService accountAccessService;
	
	public News news;
	
	public News getNews() {
		return news;
	}

	public void setNews(News news) {
		this.news = news;
	}

	long beginTimestamp;

	File[] img; // 上传的文件
	String[] imgFileName; // 文件名称
	String[] imgContentType; // 文件类型

	Message message;

	public Map responseJson = new HashMap<String, Object>();
	
	Account regAccount;

	public Account getRegAccount() {
		return regAccount;
	}

	public void setRegAccount(Account regAccount) {
		this.regAccount = regAccount;
	}

	public File[] getImg() {
		return img;
	}

	public void setImg(File[] img) {
		this.img = img;
	}

	public String[] getImgFileName() {
		return imgFileName;
	}

	public void setImgFileName(String[] imgFileName) {
		this.imgFileName = imgFileName;
	}

	public String[] getImgContentType() {
		return imgContentType;
	}

	public void setImgContentType(String[] imgContentType) {
		this.imgContentType = imgContentType;
	}

	public Message getMessage() {
		return message;
	}

	public void setMessage(Message message) {
		this.message = message;
	}

	public Map getResponseJson() {
		return responseJson;
	}

	public void setResponseJson(Map responseJson) {
		this.responseJson = responseJson;
	}

	public IndexPageService getIndexPageService() {
		return indexPageService;
	}

	public void setIndexPageService(IndexPageService indexPageService) {
		this.indexPageService = indexPageService;
	}

	@Override
	public Integer getRows() {
		if (rows == null || rows <= 0) {
			return 20;
		}
		return rows;
	}
}
